package com.lengxf.design;

public class EncryptFacade extends AbstractEncryptFacade {
    private final FileReader fileReader;

    private final CipherMachine cipherMachine;

    private final FileWriter fileWriter;

    public EncryptFacade() {
        this.fileReader = new FileReader();
        this.cipherMachine = new CipherMachine();
        this.fileWriter = new FileWriter();
    }

    public void fileEncrypt(String fileNameSrc, String fileNameDesc) {
        String plainStr = fileReader.read(fileNameSrc);
        String encryptStr = cipherMachine.encrypt(plainStr);
        fileWriter.write(encryptStr, fileNameDesc);
    }

}
